**** OPEN OUTPUT LOG FILE  *****


log using "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\OUTPUT\Performance Management.APPENDIX C MODELS.04-10-2025.smcl", replace 







*** MODELS PREDICTING VARIOPUS TYPE OF PROGRAM ERROR RATES BASED ON BAM SAMPLING RATES ***





*** MODEL 1: OVERALL ERROR RATE: (SAMPLE WEIGHTED) ***

*  [# overpayment errors / paid claims sample] + [# underpayment errors / paid claims sample] + [# erroneous denials / denied claims sample] + [# underpayment errors / denied claims sample] *



*** MODEL 2: ABSOLUTE TYPE I ERROR RATE ***

* [overpayment error rate / paid claims sample] *




*** MODEL 3: RELATIVE TYPE I ERROR RATE:  {TYPE I ERROR RATE /  [TYPE I ERROR RATE + TYPE II ERROR RATE]}      (SAMPLE WEIGHTED)  ***

*  {[overpayment error rate / paid claims sample]   /  [overpayment error rate / paid claims sample]   +  [underpayment error rate / paid claims sample]  +  [erroneous denial / denied claims sample]  +  [underpayment error / denied claims sample]}  *






**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************






*** APPENDIX C MODELS: ANALYZING SENSITIVITY OF MANUSCRIPT MODEL ESTIMATES -- INCLUSION OF NON-IT MODERNIZATION STATES DURING PRE-IT MODERNIZATION REFORM ADOPTION PHASE ***







**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************






*** RETRIEVE MANUSCRIPT MODELS DATABASE [as of 04-10-2025] ***


use "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\DATA\Performance Management.MANUSCRIPT DATABASE.04-10-2025.dta", replace




*** SET DATA TO PANEL STRUCTURE  ***

xtset stateid monthyear, monthly

*
*
*
*


**** TABLE C1 -- MODELS C1-C3: "TASK COMPLEXITY, ORGANIZATIONAL ADAPTATION & PROGRAM ERROR RATES" APPENDIX C STATISTICAL ANALYSES [DECEMBER 2024]: ORGANIZATIONAL ADAPTATION EFFECTS ON PROGRAM PAYMENT ERROR RATES [TOTAL PROGRAM ERROR RATE] **** 


** (MODEL C1; FIGURES C1A-C1C; MODEL C2: FIGURES C2A-C2C; MODEL C3: FIGURES C2D-C2F) **





****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** COMPUTE CATEGORICAL TASK COMPLEXITY COVARIATE MEASURES [CONDITIONAL ADAPTATION TO IT MODERNIZATION REFORMS] ***

** PURPOSE: COMPUTE MARGINAL DIFFERENTIAL EFFECTS IN MANUSCRIPT MODELS [BASED ON EFFECTIVE SAMPLE OF OBSERVATIONS] **



** (1) INTERSTATE CASE RATES [PAID & DENIED CLAIMS SAMPLES: TOTAL ERROR RATE & RELATIVE TYPE I ERROR RATE [MODELS 1 & 3];  PAID CLAIMS SAMPLE ONLY: ABSOLUTE TYPE I ERROR RATE [MODEL 2] **


* Overall Program Error Rate *

quietly reg totalerror_rat  itmod_monthcount  tot_interstate    tot_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt 
*
*
sum tot_interstate if e(sample), detail
di r(p75)
di r(p25)
*
gen tot_interstate_catC =.
replace tot_interstate_catC = 0 if tot_interstate<= r(p25) 
replace tot_interstate_catC = 1 if tot_interstate> r(p25) & tot_interstate < r(p75) 
replace tot_interstate_catC = 2 if tot_interstate>= r(p75) 
*
tab tot_interstate_catC
tab tot_interstate_catC if itmod_adopt_state==1

*
*
*

* Absolute Type I Error Rate *

quietly reg t1error_rat  itmod_monthcount  t1_interstate    t1_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  t1_totalnonwhite_rat t1_totalfemale_rat t1_totalageu25o65_rat  i.stateid i.year adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt
*
*
sum t1_interstate if e(sample), detail
di r(p75)
di r(p25)
*
gen t1_interstate_catC =.
replace t1_interstate_catC = 0 if t1_interstate<= r(p25) 
replace t1_interstate_catC = 1 if t1_interstate> r(p25) & t1_interstate < r(p75) 
replace t1_interstate_catC = 2 if t1_interstate>= r(p75) 
*
tab t1_interstate_catC
tab t1_interstate_catC if itmod_adopt_state==1
*
*
*

* Relative Type I Error Rate [same as Overall Program Error Rate since Contains Both Type I & Type II Program Error Rates] *

quietly reg relt1error_rat  itmod_monthcount  tot_interstate    tot_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt
*
*
sum tot_interstate if e(sample), detail
di r(p75)
di r(p25)
*
gen relt1_interstate_catC =.
replace relt1_interstate_catC = 0 if tot_interstate<= r(p25) 
replace relt1_interstate_catC = 1 if tot_interstate> r(p25) & tot_interstate < r(p75) 
replace relt1_interstate_catC = 2 if tot_interstate>= r(p75) 
*
tab relt1_interstate_catC
tab relt1_interstate_catC if itmod_adopt_state==1
*



*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




** (2) DIFFERENT OCCUPATION SEEKING RATE [PAID & DENIED CLAIMS SAMPLES: TOTAL ERROR RATE & RELATIVE TYPE I ERROR RATE [MODELS 1 & 3];  PAID CLAIMS SAMPLE ONLY: ABSOLUTE TYPE I ERROR RATE [MODEL 2] **


* Overall Program Error Rate *

quietly reg totalerror_rat  itmod_monthcount  tot_interstate    tot_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt

sum tot_diffoccupseek if e(sample), detail
di r(p75)
di r(p25)
*
gen tot_diffoccupseek_catC =.
replace tot_diffoccupseek_catC = 0 if tot_diffoccupseek<= r(p25) 
replace tot_diffoccupseek_catC = 1 if tot_diffoccupseek> r(p25) & tot_diffoccupseek < r(p75) 
replace tot_diffoccupseek_catC = 2 if tot_diffoccupseek>= r(p75) 
*
tab tot_diffoccupseek_catC
tab tot_diffoccupseek_catC if itmod_adopt_state==1

*
*
*

* Absolute Type I Error Rate *

quietly reg t1error_rat  itmod_monthcount  t1_interstate    t1_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  t1_totalnonwhite_rat t1_totalfemale_rat t1_totalageu25o65_rat  i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt
*
*
sum t1_diffoccupseek if e(sample), detail
di r(p75)
di r(p25)
*
gen t1_diffoccupseek_catC =.
replace t1_diffoccupseek_catC = 0 if t1_diffoccupseek<= r(p25) 
replace t1_diffoccupseek_catC = 1 if t1_diffoccupseek> r(p25) & t1_diffoccupseek < r(p75) 
replace t1_diffoccupseek_catC = 2 if t1_diffoccupseek>= r(p75) 
*
tab t1_diffoccupseek_catC
tab t1_diffoccupseek_catC if itmod_adopt_state==1
*
*
*

* Relative Type I Error Rate [same as Overall Program Error Rate since Contains Both Type I & Type II Program Error Rates] *

quietly reg relt1error_rat  itmod_monthcount  tot_interstate    tot_diffoccupseek demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year   adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt
*
*
sum tot_diffoccupseek if e(sample), detail
di r(p75)
di r(p25)
*
gen relt1_diffoccupseek_catC =.
replace relt1_diffoccupseek_catC = 0 if tot_diffoccupseek<= r(p25) 
replace relt1_diffoccupseek_catC = 1 if tot_diffoccupseek> r(p25) & tot_diffoccupseek < r(p75) 
replace relt1_diffoccupseek_catC = 2 if tot_diffoccupseek>= r(p75) 
*
tab relt1_diffoccupseek_catC
tab relt1_diffoccupseek_catC if itmod_adopt_state==1



**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** TESTING H1 & H3: TOTAL/OVERALL PROGRAM ERROR RATE ORGANIZATIONAL ADAPTATION  ***




*** ESTIMATE MODEL C1: TOTAL PROGRAM ERROR RATE [MODEL 1 with ADDITIONAL COVARIATES: PROPORTION OF SAMPLE-WEIGHTED CASES OF TOTAL ERROIRS VIA WEEKLY BAM SURVEY AGGREGATED TO MONTHLY OBSERVATIONS: [CONTROLS, PLUS STATE, YEAR, AND YEAR-ADOPTION COHORT UNIT EFFECTS] *** 	(FIGURES C1A-C1C) 


npregress series totalerror_rat  itmod_monthcount i.tot_interstate_catC  i.tot_diffoccupseek_catC, asis(demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat    i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt)  vce(bootstrap, seed(123) rep(1000))
*
*
** COMPUTE PSEUDO R^2 [SSE / (SSE + SSR) = EXPLAINED/PREDICTED SUM OF SQUARES / (EXPLAINED/PREDICTED SUM OF SQUARES + RESIDUAL SUM OF SQUARES)] = SSE / SST

predict predsy_m1c if e(sample)
predict residsy_m1c if e(sample), residuals

gen sse_m1c = predsy_m1c * predsy_m1c if e(sample)
gen ssr_m1c = residsy_m1c * residsy_m1c if e(sample)

egen sum_sse_m1c = total(sse_m1c) if e(sample)
egen sum_ssr_m1c = total(ssr_m1c) if e(sample)

gen r2_m1c = sum_ssr_m1c/(sum_sse_m1c + sum_ssr_m1c)

sum r2_m1c




* [MODEL C1: TOTAL PROGRAM ERROR RATE] FIGURE C1A: UNCONDITIONAL ADAPTATION EFFECTS --  E(Y) [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]

margins, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))


marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) ///
legend(on order(1 "Unconditional Adaptation") pos(6) ring(2) cols(2) size(9pt))  ///
title(" {bf:FIGURE C1A}""{bf:Unconditional Adaptation Effect}" "{bf:(Total Program Error Rate [MODEL C1])}", size(10pt) linegap(0.7) margin(t+1 b+2 r-6)) ///
xtitle("Months since Adoption", size(10pt) margin(t+2 b+2)) ///
ytitle("Total Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model C1.FIGURE C1A.04-10-2024.gph", replace





* [MODEL C1: TOTAL PROGRAM ERROR RATE] FIGURE C1B: MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (tot_interstate_cat==2) & LOW COMPLEXITY (tot_interstate_cat==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.tot_interstate_catC if tot_interstate_catC==0|tot_interstate_catC==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE C1B}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Interstate Claims: Total Program Error Rate [MODEL C1])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-6)) ///
xtitle("Months since Adoption", size(10pt) margin(t+2 b+2)) ///
ytitle("Total Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model C1.FIGURE C1B.04-10-2024.gph", replace





* [MODEL C1: TOTAL ERROR RATE] FIGURE C1C:  MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (tot_diffoccupseek_cat==2) & LOW COMPLEXITY (tot_extbenefits_cat==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.tot_diffoccupseek_catC if tot_diffoccupseek_catC==0|tot_diffoccupseek_catC==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE C1C}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Seeking Different Occupation: Total Program Error Rate [MODEL C1])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-6)) ///
xtitle("Months since Adoption", size(10pt) margin(t+2 b+2)) ///
ytitle("Total Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model C1.FIGURE C1C.04-10-2024.gph", replace






****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** TESTING H2 & H4: ABSOLUTE TYPE I PROGRAM ERROR RATE ORGANIZATIONAL ADAPTATION  ***



*** ESTIMATE MODEL C2: ABSOLUTE TYPE I PROGRAM ERROR RATE [MODEL 2 with ADDITIONAL COVARIATES: PROPORTION OF TOTAL ERRORS VIA WEEKLY BAM SURVEY AGGREGATED TO MONTHLY OBSERVATIONS: [CONTROLS, PLUS STATE, YEAR, AND YEAR-ADOPTION COHORT UNIT EFFECTS] *** 	(FIGURES C2A-C2C) 


npregress series t1error_rat  itmod_monthcount  i.t1_interstate_catC  i.t1_diffoccupseek_catC, asis(demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal  t1_totalnonwhite_rat t1_totalfemale_rat t1_totalageu25o65_rat    i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt)  vce(bootstrap, seed(123) rep(1000))

*
*

** COMPUTE PSEUDO R^2 [SSE / (SSE + SSR) = EXPLAINED/PREDICTED SUM OF SQUARES / (EXPLAINED/PREDICTED SUM OF SQUARES + RESIDUAL SUM OF SQUARES)] = SSE / SST

predict predsy_m2c if e(sample)
predict residsy_m2c if e(sample), residuals

gen sse_m2c = predsy_m2c * predsy_m2c if e(sample)
gen ssr_m2c = residsy_m2c * residsy_m2c if e(sample)

egen sum_sse_m2c = total(sse_m2c) if e(sample)
egen sum_ssr_m2c = total(ssr_m2c) if e(sample)

gen r2_m2c = sum_ssr_m2c/(sum_sse_m2c + sum_ssr_m2c)

sum r2_m2c


* [MODEL C2: ABSOLUTE TYPE I PROGRAM ERROR RATE] FIGURE C2A: UNCONDITIONAL ADAPTATION EFFECTS --  E(Y) [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]

margins, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) ///
legend(on order(1 "Unconditional Adaptation") pos(6) ring(2) cols(2) size(9pt))  ///
title(" {bf:FIGURE C2A}""{bf:Unconditional Adaptation Effect}" "{bf:(Absolute Type I Program Error Rate [MODEL C2])}", size(10pt) linegap(0.7) margin(t+1 b+2 r-6)) ///
xtitle("Months since Adoption", size(10pt) margin(t+2 b+2)) ///
ytitle("Absolute Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(#3, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model C2.FIGURE C2A.04-10-2024.gph", replace




* [MODEL C2: ABSOLUTE TYPE I PROGRAM ERROR RATE] FIGURE C2B:  MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (t1_interstate_catC==2) & LOW COMPLEXITY (t1_interstate_catC==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.t1_interstate_catC if t1_interstate_catC==0|t1_interstate_catC==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE C2B}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Interstate Claims: Absolute Type I Program Error Rate [MODEL C2])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-6)) ///
xtitle("Months since Adoption", size(10pt) margin(t+2 b+2)) ///
ytitle("Absolute Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model C2.FIGURE C2B.04-10-2024.gph", replace




* [MODEL C2: ABSOLUTE TYPE I PROGRAM ERROR RATE] FIGURE C2C: MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (t1_diffoccupseek_catC==2) & LOW COMPLEXITY (t1_diffoccupseek_catC==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***

margins r.t1_diffoccupseek_catC if t1_diffoccupseek_catC==0|t1_diffoccupseek_catC==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE C2C}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Seeking Different Occupation: Absolute Type I Program Error Rate [MODEL C2])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-6)) ///
xtitle("Months since Adoption", size(10pt) margin(t+2 b+2)) ///
ytitle("Absolute Type I Program Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(#3, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model C2.FIGURE C2C.04-10-2024.gph", replace



****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





*** TESTING H2 & H4: RELATIVE TYPE I ERROR RATE [TYPE I ERROR RATE / (TYPE I ERROR RATE + TYPE II ERROR RATE)] ORGANIZATIONAL ADAPTATION ***




*** ESTIMATE MODEL C3: RELATIVE TYPE I ERROR RATE [MODEL 3 with ADDITIONAL COVARIATES: PROPORTION OF SAMPLE-WEIGHTED CASES OF TOTAL ERRORS VIA WEEKLY BAM SURVEY AGGREGATED TO MONTHLY OBSERVATIONS: [CONTROLS, PLUS STATE, YEAR, AND YEAR-ADOPTION COHORT UNIT EFFECTS] ***  (FIGURES C2D-C2F) 


npregress series relt1error_rat  itmod_monthcount  i.relt1_interstate_catC i.relt1_diffoccupseek_catC, asis(demgovparty repgovparty ln_workload automationrate ln_uiadmin_budget_real benefitgenerosity2 unemp_rate ln_function_sup_avgsalreal tot_totalnonwhite_rat tot_totalfemale_rat tot_totalageu25o65_rat  i.stateid i.year  adoptcohort_2002_itadopt  adoptcohort_2004_itadopt  adoptcohort_2006_itadopt adoptcohort_2007_itadopt   adoptcohort_2009_itadopt  adoptcohort_2010_itadopt  adoptcohort_2013_itadopt  adoptcohort_2014_itadopt  adoptcohort_2015_itadopt  adoptcohort_2016_itadopt  adoptcohort_2017_itadopt  adoptcohort_2018_itadopt  adoptcohort_2020_itadopt  adoptcohort_2021_itadopt)  vce(bootstrap, seed(123) rep(1000))

*
*

** COMPUTE PSEUDO R^2 [SSE / (SSE + SSR) = EXPLAINED/PREDICTED SUM OF SQUARES / (EXPLAINED/PREDICTED SUM OF SQUARES + RESIDUAL SUM OF SQUARES)] = SSE / SST

predict predsy_m3c if e(sample)
predict residsy_m3c if e(sample), residuals

gen sse_m3c = predsy_m3c * predsy_m3c if e(sample)
gen ssr_m3c = residsy_m3c * residsy_m3c if e(sample)

egen sum_sse_m3c = total(sse_m3c) if e(sample)
egen sum_ssr_m3c = total(ssr_m3c) if e(sample)

gen r2_m3c = sum_ssr_m3c/(sum_sse_m3c + sum_ssr_m3c)

sum r2_m3c


* [MODEL C3: RELATIVE TYPE I ERROR RATE] FIGURE C2D: UNCONDITIONAL ADAPTATION EFFECTS --  E(Y) [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]

margins, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) ///
legend(on order(1 "Unconditional Adaptation") pos(6) ring(2) cols(2) size(9pt))  ///
title(" {bf:FIGURE C2D}""{bf:Unconditional Adaptation Effect}" "{bf:(Relative Type I Error Rate [MODEL C3])}", size(10pt) linegap(0.7) margin(t+1 b+2 r+5)) ///
xtitle("Months since Adoption", size(10pt) margin(t+2 b+2)) ///
ytitle("Relative Type I Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model C3.FIGURE C2D.04-10-2024.gph", replace




* [MODEL C3: RELATIVE TYPE I ERROR RATE] FIGURE C2E:  MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (relt1_interstate_catC==2) & LOW COMPLEXITY (relt1_interstate_catC==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***


margins r.relt1_interstate_catC if relt1_interstate_catC==0|relt1_interstate_catC==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE C2E}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Interstate Claims: Relative Type I Error Rate [MODEL C3])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-6)) ///
xtitle("Months since Adoption", size(10pt) margin(t+2 b+2)) ///
ytitle("Relative Type I Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model C3.FIGURE C2E.04-10-2024.gph", replace
*




* [MODEL C3: RELATIVE TYPE I ERROR RATE] FIGURE C2F:  MARGINAL DIFFERENTIAL EFFECT BETWEEN HIGH TASK COMPLEXITY (relt1_diffoccupseek_catC==2) & LOW COMPLEXITY (relt1_diffoccupseek_catC==0) VALUES [WITH RESPECT TO MONTHS SINCE ADOPTION (t + k) : 0 1 6 12.....60]: ***
margins r.relt1_diffoccupseek_catC if relt1_diffoccupseek_catC==0|relt1_diffoccupseek_catC==2, at(itmod_monthcount=(0 1 6 12 18 24 30 36 42 48 54 60))

marginsplot, recast(connected) ciopt(color(%40)) recastci(rarea) /// 
yline(0, lcolor(%40gs) lpattern(shortdash)) ///
legend(on order(1 "High Task Complexity - Low Task Complexity") pos(6) ring(2) cols(2) size(10pt))  ///
title(" {bf:FIGURE C2F}""{bf:Conditional Adaptation Marginal Effect By Task Complexity}" "{bf:(Seeking Different Occupation: Relative Type I Error Rate [MODEL C3])}", size(10pt) linegap(0.7) margin(t+1 b+1 r-6)) ///
xtitle("Months since Adoption", size(10pt) margin(t+2 b+2)) ///
ytitle("Relative Type I Error Rate", size(10pt) margin(r+2)) ///
xlabel(0 "0" 1 "1" 6 "6" 12 "12" 18 "18" 24 "24" 30 "30" 36 "36" 42 "42" 48 "48" 54 "54" 60 "60", labsize(9pt) ) ///
ylabel(, labsize(9pt) format(%9.2f) angle(0)) xsize(6)
*
*
*
graph save "Graph" "C:\Users\gk57526\Dropbox\Administration of UI Programs in the American States (Ji-Hyeun Hong)\Performance Management Project (Paper #3)\EMPIRICS\GRAPHICS\marginsplot.Model C3.FIGURE C2F.04-10-2024.gph", replace




***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
***********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************





log close
